<template>
  <div class="medical-analysis">
    <keep-alive>
      <component
      :is="currentComponent"
      @current="current"
      ></component>
    </keep-alive>
  </div>
</template>

<script>
import MedicalAnalysis from "./medicalAnalysis.vue";
import AnalysisByRegion from "./analysisByRegion.vue";
import AnalysisDetail from "./analysisDetail.vue";

export default {
  components: {
    MedicalAnalysis,
    AnalysisByRegion,
    AnalysisDetail
  },
  data() {
    return {
      currentComponent: MedicalAnalysis,
    }
  },
  methods: {
    current(val) {
      console.log("----",val);
      switch (val) {
        case 1:
          this.currentComponent = AnalysisByRegion;
          break;
        case 2:
          this.currentComponent = AnalysisDetail;
          break;
        default:
          this.currentComponent = MedicalAnalysis;
          break;
      }
    }
  }
}
</script>

<style>

</style>